#!/bin/sh

. "$(dirname "$0")/configure-common"

TOOLCHAIN_FILE="$SOURCE/cmake/Toolchain/Toolchain-mingw-w64-$(uname -m).cmake"
if [ ! -f "${TOOLCHAIN_FILE}" ]
then
	echo "Toolchain file ${TOOLCHAIN_FILE} needed for cross compiling doesn't exist"
	exit 1
fi

# BUILD_SHARED and BUILD_TESTING is currently broken

cd $BUILD
cmake	-DENABLE_TESTING=OFF \
	-DBUILD_TESTING=OFF \
	-DBUILD_STATIC=ON \
	-DBUILD_FULL=ON \
	-DBUILD_SHARED=OFF \
	-DPLUGINS="wresolver;dump" \
	-DKDB_DEFAULT_RESOLVER=wresolver  \
	-DKDB_DB_SYSTEM=kdb -DKDB_DB_SPEC=spec \
	-DBUILD_DOCUMENTATION=OFF \
	-DCMAKE_PIC_FLAGS="" \
	-DCMAKE_TOOLCHAIN_FILE=$TOOLCHAIN_FILE \
	$*
